package fr.laas.gestionProjets.modeles;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class NoeudArbre implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private NoeudArbre parent;
	
	private List<NoeudArbre> enfants = new ArrayList<NoeudArbre>();
	
	private String libelle;
	

	/**
	 * @param parent
	 * @param libelle
	 */
	public NoeudArbre(NoeudArbre parent, String libelle) {
		super();
		this.parent = parent;
		this.libelle = libelle;
		
		if(parent!=null){
			parent.getEnfants().add(this);
		}
	}

	/**
	 * @return the parent
	 */
	public NoeudArbre getParent() {
		return parent;
	}

	/**
	 * @param parent the parent to set
	 */
	public void setParent(NoeudArbre parent) {
		this.parent = parent;
	}

	/**
	 * @return the libelle
	 */
	public String getLibelle() {
		return libelle;
	}

	/**
	 * @param libelle the libelle to set
	 */
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	/**
	 * @return the enfants
	 */
	public List<NoeudArbre> getEnfants() {
		return enfants;
	}

	/**
	 * @param enfants the enfants to set
	 */
	public void setEnfants(List<NoeudArbre> enfants) {
		this.enfants = enfants;
	}
	
	
}
